{extend name="../template/admin/base.html" /}
{block name="index_right"}
<ul class="nav nav-tabs" role="tablist">
    <li class="active"><a href="{:url('admin/category/index')}">栏目列表</a></li>
    <li><a href="{:url('post')}">栏目添加</a></li>
</ul>
<div class="panel panel-default">
    <div class="panel-heading">
        <h3 class="panel-title">栏目管理</h3>
    </div>
    <div class="panel-body">
        <table class="table table-hover">
            <thead>

            <tr>
                <th>栏目编号</th>
                <th>栏目名称</th>
                <th>栏目排序</th>
                <th>操作</th>
            </tr>
            {volist name="category" id="vo"}
            <tr>
                <th>{$vo.cate_id}</th>
                <th>{$vo._cate_name}</th>
                <th>{$vo.cate_sort}</th>
                <td>
                <div class="btn-group btn-group-sm">
                    <a href="{:url('admin/category/post',['cid'=>$vo.cate_id])}" class="btn btn-success">编辑</a>
                    <a href="javascript:;" onclick="del({$vo['cate_id']})" class="btn btn-danger">删除</a>
                </div>
            </td>
            </tr>
            {/volist}
            </thead>
        </table>

    </div>
</div>

<script>
    function del(cate_id){

        require(['util'],function (util) {
            util.confirm('确定删除吗?', function () {
                location.href = "{:url('del')}?cid=" + cate_id;
            })
        })

    }
</script>
{/block}